package common.fengkai.filepost.conf;

import common.fengkai.filepost.webservice.TestWrbvservices;
import org.apache.cxf.bus.spring.SpringBus;
import org.apache.cxf.jaxws.EndpointImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.xml.ws.Endpoint;

/**
 * webservice服务配置类
 */
@Configuration
public class WebserviceConfig {

    /**
     *
     * @return
     */
    @Bean
    public SpringBus cxf(){
        return  new SpringBus();
    }

    /**
     * 配置需要暴露的接口
     */
    @Bean
    public Endpoint TestWrbvservicesEndpoint(@Autowired SpringBus cxf, @Autowired TestWrbvservices testWrbvservices){
        EndpointImpl endpoint = new EndpointImpl(cxf, testWrbvservices);
        //设置暴露地址
        endpoint.publish("/testWrbvservices");
        return  endpoint;
    }

}
